home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / scoobysnackmachine.swf / scripts / __Packages / WheelRail.as < prev   
Text File  |  2007-10-01  |  13KB  |  347 lines

  1. var ┬º\x01┬º = 963;
  2. while(true)
  3. {
  4.    if(eval("\x01") == 963)
  5.    {
  6.       set("\x01",eval("\x01") - 678);
  7.       ┬º┬ºpush(true);
  8.    }
  9.    else if(eval("\x01") == 511)
  10.    {
  11.       set("\x01",eval("\x01") - 460);
  12.    }
  13.    else if(eval("\x01") == 410)
  14.    {
  15.       set("\x01",eval("\x01") + 386);
  16.    }
  17.    else
  18.    {
  19.       if(eval("\x01") == 796)
  20.       {
  21.          set("\x01",eval("\x01") + 27);
  22.          if(!_global.WheelRail)
  23.          {
  24.             var _loc2_ = _global.WheelRail = function(__mcRef)
  25.             {
  26.                this.mcRef = __mcRef;
  27.                this.nSlowFactor = 1;
  28.                this.nAngle = 0;
  29.                this.nDistanceMade = 0;
  30.                this.nDirection = WheelRail.DIRECTION_LEFT;
  31.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  32.                this.bSearchingForAffectation = true;
  33.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  34.                Level.__get__Instance().doAddListener(this);
  35.             }.prototype;
  36.             _loc2_.setRotation = function(__nAngle)
  37.             {
  38.                this.nAngle = __nAngle;
  39.                this.mcRef._rotation = this.nAngle;
  40.             };
  41.             _loc2_.setInitialDirection = function(__nDirection)
  42.             {
  43.                this.nDirection = __nDirection;
  44.             };
  45.             _loc2_.doEnterFrame = function()
  46.             {
  47.                if(this.bSearchingForAffectation)
  48.                {
  49.                   if(this.nSearchedTime > 0)
  50.                   {
  51.                      this.nSearchedTime = this.nSearchedTime - 1;
  52.                      this.doSearchWheel();
  53.                   }
  54.                   else
  55.                   {
  56.                      this.bSearchingForAffectation = false;
  57.                   }
  58.                }
  59.                else
  60.                {
  61.                   this.doMoveWheel();
  62.                }
  63.             };
  64.             _loc2_.doDestroy = function()
  65.             {
  66.                delete this.oWheelAffected;
  67.             };
  68.             _loc2_.doMoveWheel = function()
  69.             {
  70.                var _loc2_ = undefined;
  71.                if(this.nDirection == WheelRail.DIRECTION_LEFT)
  72.                {
  73.                   _loc2_ = -1;
  74.                }
  75.                else
  76.                {
  77.                   _loc2_ = 1;
  78.                }
  79.                var _loc3_ = _loc2_ * WheelRail.MOVE_SPEED;
  80.                if(Math.abs(this.nDistanceMade) >= this.nMaxDistance * WheelRail.PERCENT_DIST_MADE_DECEL)
  81.                {
  82.                   if(_loc2_ == Library.Utils.MoreMath.getPolarity(this.nDistanceMade))
  83.                   {
  84.                      this.nSlowFactor -= WheelRail.DECEL_ON_EDGES;
  85.                      if(this.nSlowFactor < WheelRail.MAX_SLOW_FACTOR)
  86.                      {
  87.                         this.nSlowFactor = WheelRail.MAX_SLOW_FACTOR;
  88.                      }
  89.                   }
  90.                   else
  91.                   {
  92.                      this.nSlowFactor += WheelRail.DECEL_ON_EDGES;
  93.                      if(this.nSlowFactor > 1)
  94.                      {
  95.                         this.nSlowFactor = 1;
  96.                      }
  97.                   }
  98.                   _loc3_ *= this.nSlowFactor;
  99.                }
  100.                else
  101.                {
  102.                   this.nSlowFactor = 1;
  103.                }
  104.                this.nDistanceMade += _loc3_;
  105.                var _loc4_ = Library.Utils.MoreMath.getRadianFromDegree(this.nAngle);
  106.                var _loc5_ = Math.cos(_loc4_) * this.nDistanceMade;
  107.                var _loc6_ = Math.sin(_loc4_) * this.nDistanceMade;
  108.                this.oWheelAffected.__get__Ref()._x = this.mcRef._x + _loc5_;
  109.                this.oWheelAffected.__get__Ref()._y = this.mcRef._y + _loc6_;
  110.                if(Math.abs(this.nDistanceMade) > this.nMaxDistance)
  111.                {
  112.                   if(this.nDirection == WheelRail.DIRECTION_LEFT)
  113.                   {
  114.                      this.nDirection = WheelRail.DIRECTION_RIGHT;
  115.                   }
  116.                   else
  117.                   {
  118.                      this.nDirection = WheelRail.DIRECTION_LEFT;
  119.                   }
  120.                }
  121.             };
  122.             _loc2_.doSearchWheel = function()
  123.             {
  124.                var _loc3_ = Level.__get__Instance().__get__Objects();
  125.                var _loc7_ = this.mcRef._x;
  126.                var _loc8_ = this.mcRef._y;
  127.                var _loc2_ = 0;
  128.                while(_loc2_ <= _loc3_.length - 1)
  129.                {
  130.                   if(_loc3_[_loc2_].ObjectType == Level.OBJECT_TYPE_WHEEL)
  131.                   {
  132.                      var _loc5_ = _loc3_[_loc2_].Ref._x;
  133.                      var _loc6_ = _loc3_[_loc2_].Ref._y;
  134.                      var _loc4_ = Library.Utils.MoreMath.getDistance(_loc7_,_loc8_,_loc5_,_loc6_);
  135.                      if(_loc4_ <= WheelRail.AFFECT_DISTANCE_ADDON + Math.max(this.mcRef._width / 2,this.mcRef._height / 2))
  136.                      {
  137.                         this.oWheelAffected = _loc3_[_loc2_];
  138.                         this.oWheelAffected.__get__Ref()._x = this.mcRef._x;
  139.                         this.oWheelAffected.__get__Ref()._y = this.mcRef._y;
  140.                         this.doMoveWheel();
  141.                         this.bSearchingForAffectation = false;
  142.                         _loc2_ = _loc3_.length;
  143.                      }
  144.                   }
  145.                   _loc2_ = _loc2_ + 1;
  146.                }
  147.             };
  148.             _global.WheelRail = function(__mcRef)
  149.             {
  150.                this.mcRef = __mcRef;
  151.                this.nSlowFactor = 1;
  152.                this.nAngle = 0;
  153.                this.nDistanceMade = 0;
  154.                this.nDirection = WheelRail.DIRECTION_LEFT;
  155.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  156.                this.bSearchingForAffectation = true;
  157.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  158.                Level.__get__Instance().doAddListener(this);
  159.             }.DIRECTION_LEFT = 1;
  160.             _global.WheelRail = function(__mcRef)
  161.             {
  162.                this.mcRef = __mcRef;
  163.                this.nSlowFactor = 1;
  164.                this.nAngle = 0;
  165.                this.nDistanceMade = 0;
  166.                this.nDirection = WheelRail.DIRECTION_LEFT;
  167.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  168.                this.bSearchingForAffectation = true;
  169.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  170.                Level.__get__Instance().doAddListener(this);
  171.             }.DIRECTION_RIGHT = 2;
  172.             _global.WheelRail = function(__mcRef)
  173.             {
  174.                this.mcRef = __mcRef;
  175.                this.nSlowFactor = 1;
  176.                this.nAngle = 0;
  177.                this.nDistanceMade = 0;
  178.                this.nDirection = WheelRail.DIRECTION_LEFT;
  179.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  180.                this.bSearchingForAffectation = true;
  181.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  182.                Level.__get__Instance().doAddListener(this);
  183.             }.AFFECT_DISTANCE_ADDON = 35;
  184.             _global.WheelRail = function(__mcRef)
  185.             {
  186.                this.mcRef = __mcRef;
  187.                this.nSlowFactor = 1;
  188.                this.nAngle = 0;
  189.                this.nDistanceMade = 0;
  190.                this.nDirection = WheelRail.DIRECTION_LEFT;
  191.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  192.                this.bSearchingForAffectation = true;
  193.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  194.                Level.__get__Instance().doAddListener(this);
  195.             }.SEARCH_MAX_TIME = 2;
  196.             _global.WheelRail = function(__mcRef)
  197.             {
  198.                this.mcRef = __mcRef;
  199.                this.nSlowFactor = 1;
  200.                this.nAngle = 0;
  201.                this.nDistanceMade = 0;
  202.                this.nDirection = WheelRail.DIRECTION_LEFT;
  203.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  204.                this.bSearchingForAffectation = true;
  205.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  206.                Level.__get__Instance().doAddListener(this);
  207.             }.MOVE_SPEED = 1.2;
  208.             _global.WheelRail = function(__mcRef)
  209.             {
  210.                this.mcRef = __mcRef;
  211.                this.nSlowFactor = 1;
  212.                this.nAngle = 0;
  213.                this.nDistanceMade = 0;
  214.                this.nDirection = WheelRail.DIRECTION_LEFT;
  215.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  216.                this.bSearchingForAffectation = true;
  217.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  218.                Level.__get__Instance().doAddListener(this);
  219.             }.EDGE_BUFFER = 10;
  220.             _global.WheelRail = function(__mcRef)
  221.             {
  222.                this.mcRef = __mcRef;
  223.                this.nSlowFactor = 1;
  224.                this.nAngle = 0;
  225.                this.nDistanceMade = 0;
  226.                this.nDirection = WheelRail.DIRECTION_LEFT;
  227.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  228.                this.bSearchingForAffectation = true;
  229.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  230.                Level.__get__Instance().doAddListener(this);
  231.             }.PERCENT_DIST_MADE_DECEL = 0.5;
  232.             _global.WheelRail = function(__mcRef)
  233.             {
  234.                this.mcRef = __mcRef;
  235.                this.nSlowFactor = 1;
  236.                this.nAngle = 0;
  237.                this.nDistanceMade = 0;
  238.                this.nDirection = WheelRail.DIRECTION_LEFT;
  239.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  240.                this.bSearchingForAffectation = true;
  241.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  242.                Level.__get__Instance().doAddListener(this);
  243.             }.DECEL_ON_EDGES = 0.08;
  244.             _global.WheelRail = function(__mcRef)
  245.             {
  246.                this.mcRef = __mcRef;
  247.                this.nSlowFactor = 1;
  248.                this.nAngle = 0;
  249.                this.nDistanceMade = 0;
  250.                this.nDirection = WheelRail.DIRECTION_LEFT;
  251.                this.nMaxDistance = this.mcRef._width / 2 - WheelRail.EDGE_BUFFER;
  252.                this.bSearchingForAffectation = true;
  253.                this.nSearchedTime = WheelRail.SEARCH_MAX_TIME;
  254.                Level.__get__Instance().doAddListener(this);
  255.             }.MAX_SLOW_FACTOR = 0.1;
  256.             ┬º┬ºpush(ASSetPropFlags(_global.WheelRail.prototype,null,1));
  257.          }
  258.          ┬º┬ºpop();
  259.          break;
  260.       }
  261.       if(eval("\x01") == 948)
  262.       {
  263.          set("\x01",eval("\x01") - 80);
  264.       }
  265.       else if(eval("\x01") == 285)
  266.       {
  267.          set("\x01",eval("\x01") + 389);
  268.          if(┬º┬ºpop())
  269.          {
  270.             set("\x01",eval("\x01") + 274);
  271.          }
  272.       }
  273.       else if(eval("\x01") == 338)
  274.       {
  275.          set("\x01",eval("\x01") + 72);
  276.       }
  277.       else if(eval("\x01") == 51)
  278.       {
  279.          set("\x01",eval("\x01") + 483);
  280.          ┬º┬ºpush(true);
  281.       }
  282.       else
  283.       {
  284.          if(eval("\x01") == 674)
  285.          {
  286.             set("\x01",eval("\x01") + 274);
  287.             break;
  288.          }
  289.          if(eval("\x01") == 559)
  290.          {
  291.             set("\x01",eval("\x01") + 309);
  292.          }
  293.          else if(eval("\x01") == 726)
  294.          {
  295.             set("\x01",eval("\x01") - 316);
  296.          }
  297.          else if(eval("\x01") == 868)
  298.          {
  299.             set("\x01",eval("\x01") - 517);
  300.             ┬º┬ºpush(true);
  301.          }
  302.          else
  303.          {
  304.             if(eval("\x01") == 823)
  305.             {
  306.                set("\x01",eval("\x01") - 823);
  307.                break;
  308.             }
  309.             if(eval("\x01") == 199)
  310.             {
  311.                set("\x01",eval("\x01") + 527);
  312.                break;
  313.             }
  314.             if(eval("\x01") == 351)
  315.             {
  316.                set("\x01",eval("\x01") + 547);
  317.                if(┬º┬ºpop())
  318.                {
  319.                   set("\x01",eval("\x01") - 65);
  320.                }
  321.             }
  322.             else if(eval("\x01") == 534)
  323.             {
  324.                set("\x01",eval("\x01") - 335);
  325.                if(┬º┬ºpop())
  326.                {
  327.                   set("\x01",eval("\x01") + 527);
  328.                }
  329.             }
  330.             else
  331.             {
  332.                if(eval("\x01") == 898)
  333.                {
  334.                   set("\x01",eval("\x01") - 65);
  335.                   break;
  336.                }
  337.                if(eval("\x01") != 833)
  338.                {
  339.                   break;
  340.                }
  341.                set("\x01",eval("\x01") - 782);
  342.             }
  343.          }
  344.       }
  345.    }
  346. }
  347.